package com.ceair.flight.refund.location.model;

import com.ceair.flight.refund.util.DateUtil;
import com.ceair.flight.refund.util.StringUtil;
import com.ceair.muservice.common.dto.AbstractBaseDO;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Random;


/**
 * 支付和产品关联表
 * @author Guy
 *
 */
@Alias("PayProductDO")
public class PayProductDO extends AbstractBaseDO implements Serializable{
    private static final long serialVersionUID = 3753905184093799740L;

    private Long payProductId;//主键
    private PayDO payDO;
    private String payId;
    private String payNo;//payno
    private String productId;//产品id
    private String orderNo;//大订单
    private Integer productType;//产品类型 1：机票  2：emd选座 3:改期 4：VIP  5:Baggage';
    private BigDecimal payAmount;// 支付金额
    private BigDecimal tktAm;// 票价
    private BigDecimal taxAm;// 税费
    private BigDecimal agentAm;// 代理费
    private BigDecimal mulctAm;// 手续费
    private BigDecimal emdAm;// 付费选座
    private BigDecimal rescheduleAm;// 改期差价
    private BigDecimal pointAmount;// 积分
	private BigDecimal baggageAm;//逾重行李费
	private BigDecimal vipAm;//vip费
	private BigDecimal gaotieAm;//高铁费
	private BigDecimal buypointAm;//购买积分费
	private BigDecimal packageAm;//套票费
    
    
    public Long getPayProductId() {
        return payProductId;
    }
    public void setPayProductId(Long payProductId) {
        this.payProductId = payProductId;
    }
    public String getProductId() {
        return productId;
    }
    public void setProductId(String productId) {
        this.productId = productId;
    }
    public String getOrderNo() {
        return orderNo;
    }
    public String getPayNo() {
        return payNo;
    }
    public void setPayNo(String payNo) {
        this.payNo = payNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    public Integer getProductType() {
        return productType;
    }
    public void setProductType(Integer productType) {
        this.productType = productType;
    }
	public PayDO getPayDO() {
		return payDO;
	}
	public void setPayDO(PayDO payDO) {
		this.payDO = payDO;
	}
	public String getPayId() {
		return payId;
	}
	public void setPayId(String payId) {
		this.payId = payId;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(this==obj){
			return true;
		}
		if(obj instanceof PayProductDO){
			PayProductDO other = (PayProductDO)obj;
			return other.getPayId().equalsIgnoreCase(this.getPayId())&&other.payProductId.equals(this.getPayProductId());
		}
		return super.equals(obj);
	}

	@Override
	public int hashCode() {
    	Random random = new Random();
    	int rdmIdx = random.nextInt(100);
		return this.getPayId().hashCode()*rdmIdx + this.getPayProductId().hashCode()*rdmIdx;
	}

	public BigDecimal getPayAmount() {
		return payAmount;
	}
	public void setPayAmount(BigDecimal payAmount) {
		this.payAmount = payAmount;
	}
	public BigDecimal getTktAm() {
		return tktAm;
	}
	public void setTktAm(BigDecimal tktAm) {
		this.tktAm = tktAm;
	}
	public BigDecimal getTaxAm() {
		return taxAm;
	}
	public void setTaxAm(BigDecimal taxAm) {
		this.taxAm = taxAm;
	}
	public BigDecimal getAgentAm() {
		return agentAm;
	}
	public void setAgentAm(BigDecimal agentAm) {
		this.agentAm = agentAm;
	}
	public BigDecimal getMulctAm() {
		return mulctAm;
	}
	public void setMulctAm(BigDecimal mulctAm) {
		this.mulctAm = mulctAm;
	}
	public BigDecimal getEmdAm() {
		return emdAm;
	}
	public void setEmdAm(BigDecimal emdAm) {
		this.emdAm = emdAm;
	}
	public BigDecimal getRescheduleAm() {
		return rescheduleAm;
	}
	public void setRescheduleAm(BigDecimal rescheduleAm) {
		this.rescheduleAm = rescheduleAm;
	}
	public BigDecimal getPointAmount() {
		return pointAmount;
	}
	public void setPointAmount(BigDecimal pointAmount) {
		this.pointAmount = pointAmount;
	}
	public BigDecimal getBaggageAm() {
		return baggageAm;
	}
	public void setBaggageAm(BigDecimal baggageAm) {
		this.baggageAm = baggageAm;
	}
	public BigDecimal getVipAm() {
		return vipAm;
	}
	public void setVipAm(BigDecimal vipAm) {
		this.vipAm = vipAm;
	}
	public BigDecimal getGaotieAm() {
		return gaotieAm;
	}
	public void setGaotieAm(BigDecimal gaotieAm) {
		this.gaotieAm = gaotieAm;
	}
	public BigDecimal getBuypointAm() {
		return buypointAm;
	}
	public void setBuypointAm(BigDecimal buypointAm) {
		this.buypointAm = buypointAm;
	}
	public BigDecimal getPackageAm() {
		return packageAm;
	}
	public void setPackageAm(BigDecimal packageAm) {
		this.packageAm = packageAm;
	}
	@Override
	public String toString() {
		return  payProductId  + StringUtil.SEPARATOR + payId+ StringUtil.SEPARATOR + productId
				+ StringUtil.SEPARATOR+createId+ StringUtil.SEPARATOR + DateUtil.toString(createDtm, StringUtil.DATEFORMATE)
				+ StringUtil.SEPARATOR+updateId+ StringUtil.SEPARATOR + DateUtil.toString(updateDtm, StringUtil.DATEFORMATE)+ StringUtil.SEPARATOR+version+ StringUtil.SEPARATOR+deleted
				+ StringUtil.SEPARATOR + orderNo + StringUtil.SEPARATOR + productType+ StringUtil.SEPARATOR+payNo
				+ StringUtil.SEPARATOR + payAmount + StringUtil.SEPARATOR + tktAm + StringUtil.SEPARATOR + taxAm + StringUtil.SEPARATOR + agentAm
				+ StringUtil.SEPARATOR + mulctAm + StringUtil.SEPARATOR + emdAm + StringUtil.SEPARATOR + rescheduleAm + StringUtil.SEPARATOR
				+ pointAmount + StringUtil.SEPARATOR + baggageAm + StringUtil.SEPARATOR + vipAm + StringUtil.SEPARATOR + gaotieAm
				+ StringUtil.SEPARATOR + buypointAm + StringUtil.SEPARATOR + packageAm
				;
	}
	
	
	
}
